/* craco.config.js */
const path = require('path')
// 引用craco-less
const CracoLessPlugin = require("craco-less");

module.exports = {
    webpack: {
        // 别名
        alias: {
            "@": path.resolve("src"),
            "PUBLIC": path.resolve("public"),
        }
    },
    //配置代理解决跨域
    devServer: {
        proxy: {
            "/api": {
                target: "http://www.lty.com/api",
                changeOrigin: true,
                pathRewrite: {
                    "^/api": ""
                }
            }
        }
    },
    //配置less
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                lessLoaderOptions: {
                    lessOptions: {
                        javascriptEnabled: true,
                    },
                },
            },
        },
    ],
}